#ifndef GAME_H
#define GAME_H

#include <iostream>
#include <list>

#include "Level.h"
#include "Renderer.h"
#include "LivingEntity.h"
#include "FactoryEntity.h"
#include "StaticData.h"
#include "HUD.h"
#include "PlayerEntity.h"
#include "Engine.h"

class Application;

class GameEngine : public Engine
{
public:
    GameEngine(Application*);
    void onLaunch();
    void onEvent(sf::Event*);
    void onTick();
    void onRender(sf::RenderWindow*);
    void onClose();

    void spawn(std::string, float, float);
    void spawn(std::string);

protected:
    Renderer renderer;
    Level level;
    bool keys[sf::Keyboard::KeyCount];

    std::list<Entity*> entities;
    FactoryEntity factory;
    PlayerEntity* player;
    sf::RectangleShape effectLayer;
    int gameOver;

    HUD hud;
};

#endif
